import cv2
import numpy as np
img=cv2.imread("build.png")
cv2.imshow('Input',img)
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
orb=cv2.ORB_create(nfeatures=2000)  #创建ORB对象
kp,des=orb.detectAndCompute(gray,None)  #检测并计算特征点
img=cv2.drawKeypoints(gray,kp,img)      #绘制特征点
cv2.imshow('drawKeypoints',img)            #显示绘制特征点的图像
print("kp.shape:",np.shape(kp))             #显示特征点数量
#显示特征向量形状
print("des.shape:",np.shape(des))
cv2.waitKey()
cv2.destroyAllWindows()